# split
l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
print(l[:4])
print(l[4:])
# skipping
s = 'bicycle'
print(s[::3])  # 跳跃3格
print(s[::-1])  # 逆序效果
# split line item
invoice = """ 
0.....6.................................40........52...55........ 
1909  Pimoroni PiBrella                     $17.50    3    $52.50 
1489  6mm Tactile Switch x20                $4.95     2    $9.90
1510  Panavise Jr. - PV-201                 $28.00    1    $28.00
1601  PiTFT Mini Kit 320x240                $34.95    1    $34.95
"""
SKU = slice(0, 6)
DESCRIPTION = slice(6, 40)
UNIT_PRICE = slice(40, 52)
QUANTITY = slice(52, 55)
ITEM_TOTAL = slice(55, None)
line_items = invoice.split('\n')[2:]
for item in line_items:
    print(item[UNIT_PRICE], item[DESCRIPTION])

# multidimensional slicing
l = list(range(12))
# del
del l[5:7]
print(l)
l[3::2] = [5, 6, 7, 8]
print(l)

